namespace cnVery.Cms.Ctrl
{
    using cnVery.Cms;
    using cnVery.Cms.Kernel;
    using System;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    public class Header : UserControl
    {
        protected string _scripts;
        protected string _title;
        protected Repeater nav;

        private void InitializeComponent()
        {
            base.Load += new EventHandler(this.Page_Load);
        }

        protected override void OnInit(EventArgs e)
        {
            this.InitializeComponent();
            base.OnInit(e);
        }

        private void Page_Load(object sender, EventArgs e)
        {
            if (this.nav != null)
            {
                this.nav.DataSource = models.GetList("");
                this.nav.DataBind();
            }
            if (this.Scripts != null)
            {
                string[] strArray = this.Scripts.Split(new char[] { ',' });
                string str = "";
                foreach (string str2 in strArray)
                {
                    str = str + "\n<script language='javascript' type='text/javascript' src='" + str2 + "'></script>";
                }
                this._scripts = str;
            }
            this._title = this._title + " -- " + Property.Name + " --";
        }

        public string Scripts
        {
            get
            {
                return this._scripts;
            }
            set
            {
                this._scripts = value;
            }
        }

        public string Title
        {
            get
            {
                return this._title;
            }
            set
            {
                this._title = value;
            }
        }
    }
}

